﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;

public partial class Business_Business_Left : System.Web.UI.UserControl
{
    private string title;
    public string Title
    {
        get { return title; }
        set 
        { title = value; }
    }

    protected string query;
    protected int Count1, Count2, Count3, Count4, Count5, Count6;

    protected void Page_Load(object sender, EventArgs e)
    {
       
       if (!this.IsPostBack)
       {
           Menu_1_1.Visible = Account.ShowForUserTypeList1("1",Session["UserType"]);
           Menu_1_2.Visible = Account.ShowForUserTypeList1("234", Session["UserType"]);
           Menu_1_3.Visible = Account.ShowForUserTypeList1("234", Session["UserType"]);
       }

       //计数器
       query = string.IsNullOrEmpty(Request["query"]) ? "all" : Request["query"].ToString();

       switch (query)
       {
           case "all":
               Count1 = News.GetCountByType("1,2,4,5", "A");
               Count2 = News.GetCountByType("1", "A");
               Count3 = News.GetCountByType("2", "A");
               Count4 = News.GetCountByType("4", "A");
               Count5 = News.GetCountByType("5", "A");
               Count6 = News.GetCountByType("6", "A");
               All.ForeColor = System.Drawing.Color.Red;
               break;
           case "day":
               Count1 = News.GetCountByType("1,2,4,5", "D");
               Count2 = News.GetCountByType("1", "D");
               Count3 = News.GetCountByType("2", "D");
               Count4 = News.GetCountByType("4", "D");
               Count5 = News.GetCountByType("5", "D");
               Count6 = News.GetCountByType("6", "D");
               Day.ForeColor = System.Drawing.Color.Red;
               break;
           case "month":
               Count1 = News.GetCountByType("1,2,4,5", "M");
               Count2 = News.GetCountByType("1", "M");
               Count3 = News.GetCountByType("2", "M");
               Count4 = News.GetCountByType("4", "M");
               Count5 = News.GetCountByType("5", "M");
               Count6 = News.GetCountByType("6", "M");
               Month.ForeColor = System.Drawing.Color.Red;
               break;
       }

    }
}
